#include "app_main.h"
int cmd_test_push_base(int argc, char *argv[])
{
    std::vector<uint8_t> vec_data;
    if (get_up_treaty_ptr() == nullptr || argc != 3)
    {
        zlog_error(zlog_get_category(ZLOG_CAG_ALL), "cmd_test_push_base", "get_up_treaty_ptr() is null");
        return -1;
    }
    int reg_num = 0;
    int data_type;
    sscanf(argv[1], "%d", &reg_num);
    sscanf(argv[2], "%d", &data_type);
    get_up_treaty_ptr()->build_rsp_status_data_packet(vec_data, reg_num, static_cast<PUSH_DATA_TYPE>(data_type));
    zlog_info(zlog_get_category(ZLOG_CAG_UP_TY), "cmd_test_push_base", "cmd_test_push_base: %d", vec_data.size());
    hzlog_info(zlog_get_category(ZLOG_CAG_UP_TY), vec_data.data(), vec_data.size());
    sendUdp("10.1.22.29", 5000, vec_data.data(), vec_data.size());
    return 0;
}
int cmd_test_push_value(int argc, char *argv[])
{
    std::vector<uint8_t> vec_data;
    if (get_up_treaty_ptr() == nullptr || argc != 3)
    {
        zlog_error(zlog_get_category(ZLOG_CAG_ALL), "cmd_test_push_base", "get_up_treaty_ptr() is null");
        return -1;
    }
    int reg_num = 0;
    int data_type;
    sscanf(argv[1], "%d", &reg_num);
    sscanf(argv[2], "%d", &data_type);
    get_up_treaty_ptr()->build_rsp_result_data_packet(vec_data, reg_num, static_cast<PUSH_DATA_TYPE>(data_type));
    zlog_info(zlog_get_category(ZLOG_CAG_UP_TY), "cmd_test_push_value", "cmd_test_push_value: %d", vec_data.size());
    hzlog_info(zlog_get_category(ZLOG_CAG_UP_TY), vec_data.data(), vec_data.size());
    sendUdp("10.1.22.29", 6666, vec_data.data(), vec_data.size());
    return 0;
}